//设置响应头中间件 第二层
module.exports = async(ctx, next) => {
  const contentType = 'application/json; charset=utf-8'
  // 设置响应头
  ctx.set('content-Type', contentType) 
  // 设置允许跨域请求的响应头
  ctx.set("Access-Control-Allow-Origin", "*")
  ctx.set("Access-Control-Allow-Methods", "OPTIONS, GET, PUT, POST, DELETE")
  await next()
}